import request from '../utils/request'
import type { User } from '../types/user'

export const login = (data : { loginname : string; password : string }) => {
	return request<{ token : string }>({
		url: 'user/login',
		method: 'POST',
		data
	})
}

export const getUserInfo = () => {
	return request<User>({
		url: 'user/info'
	})
}